from django.contrib.auth.models import AbstractUser
from django.db import models


class User(AbstractUser):
    name = models.CharField('姓名', max_length=120, null=True)
    phone_num = models.CharField('电话', max_length=20, null=True)
    roler_name = models.CharField('角色名称', max_length=50, null=True)
    password = models.CharField('密码',max_length=256, null=True)
    class Meta():
        db_table = 'user'


class Trainee(models.Model):
    name = models.CharField('学员姓名', max_length=50, null=True)
    gender = models.CharField('性别', max_length=12, null=True)
    source = models.CharField('来源', max_length=120, null=True)
    unit_name = models.CharField('单位名称', max_length=120, null=True)
    branch = models.CharField('所属部门', max_length=120, null=True)
    post = models.CharField('职务', max_length=50, null=True)
    phone_num = models.CharField('手机号', max_length=50, null=True)
    jcc_num = models.CharField('交建通账号', max_length=50, null=True)
    remark = models.CharField('备注', max_length=120, null=True)

    class Meta():
        db_table = 'trainee'


class Teacher(models.Model):
    name = models.CharField('教师姓名', max_length=50, null=True)
    gender = models.CharField('性别', max_length=12, null=True)
    internal_trainer = models.BooleanField('是否内训师', default=False)
    source = models.CharField('来源', max_length=120, null=True)
    unit_name = models.CharField('单位名称', max_length=120, null=True)
    branch = models.CharField('部门', max_length=120, null=True)
    post = models.CharField('职务', max_length=50, null=True)
    phone_num = models.CharField('手机号', max_length=50, null=True)
    cost = models.FloatField('课费(元)', null=False, default=0)
    id_num = models.CharField('身份证号', max_length=50, null=True)
    bank_info = models.TextField('开户行信息', max_length=200, null=True)
    self_intro = models.TextField('个人介绍', null=True)
    remark = models.CharField('备注', max_length=120, null=True)

    class Meta():
        db_table = 'teacher'
